package iO;

import java.io.*;
import java.nio.charset.StandardCharsets;

/**
 * @Author: Miyako
 * @Date: 2024-07-17-9:51
 * @Description: 字符输入流
 */
public class ISReaderDemo01 {
    public static void main(String[] args) throws IOException {
        FileInputStream fI1  = new FileInputStream("1.txt");
        InputStreamReader iSR = new InputStreamReader(fI1);
        File file = new File("1.txt");
        char[] cr = new char[(int) file.length()];
//        int len ;
////        while ((len=iSR.read())!=-1){//一次读一个字符，输出一个字符
////            System.out.print((char) len);
////        }
        iSR.read(cr);
        System.out.println(new String(cr));
//        for (char x : cr)
//        System.out.println(x);
        System.out.println();
        iSR.close();
    }


}
